package com.geekstudy.rpc.tool.client;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;

import java.util.LinkedHashMap;
import java.util.Map;

@RunWith(BlockJUnit4ClassRunner.class)
public class RPCClientToolVerify {


    @Test
    public void testRPCClient() {
        String serverUrl = "http://127.0.0.1:9001/rpcServer";
        String className = "com.geekstudy.week10.server.tool.MathTool";
        String methodName = "add";

        Map<String, String> paramMap = new LinkedHashMap<String, String>();
        paramMap.put("m1", "2021");
        paramMap.put("m2", "demo");

        RPCClientTool rpcClientTool = new RPCClientTool();
        Map<String, String> resultMap = rpcClientTool.invoke(serverUrl, className, methodName, paramMap);
        System.out.println("resultMap:" + resultMap);

    }
}
